package com.hp.authweb.model;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @Description: 角色信息表
 * @author hp
 * @date 2018年7月1日 下午10:11:26
 */
@Entity
@Table(name = "role")
public class RoleInfo {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	/**角色标识**/
	private String roleCode;
	
	/**角色名称**/
	private String roleName;
	
	/**角色-菜单集合**/
	@OneToMany(fetch=FetchType.EAGER)
	@JoinTable(name="role_menu_relation",joinColumns={@JoinColumn(name="roleId")},inverseJoinColumns={@JoinColumn(name="menuId")})
	private List<MenuInfo> menuList;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRoleCode() {
		return roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public List<MenuInfo> getMenuList() {
		return menuList;
	}

	public void setMenuList(List<MenuInfo> menuList) {
		this.menuList = menuList;
	}
}
